/**
 * 
 */
package com.feib.stms.dao;

import java.util.Date;
import java.util.List;

import com.feib.stms.model.TempUploadFile;
import com.feib.stms.pagination.PaginatedList;

/**
 * @author Jimmy Liu
 *
 */
public interface TempUploadFileDao 
{
	public int insert(TempUploadFile tempUploadFile );

	/**
	 * 以檔名查詢暫存檔中檢查通過的檔案(Like 查詢)
	 * @param fileName 檔名
	 * @param excludePk 需排除的 PK
	 * @return
	 */
	public List<TempUploadFile> queryValidateFileByFileName(String fileName, Long excludePk);

	/**
	 * 查詢上傳檔案(暫存檔)紀錄
	 * @param tempUploadFile 查詢物件
	 * @param uploaddDateFrom 上傳日期起
	 * @param uploadDateTo 上傳日期迄
	 * @param fileFormats 上傳格式
	 * @param paginatedList 換頁與排序條件
	 * @return 查詢結果
	 */
	public PaginatedList<TempUploadFile> queryForPaginatedListByTempUploadFile(TempUploadFile tempUploadFile, Date uploaddDateFrom, Date uploadDateTo, List<String> fileFormats, PaginatedList<TempUploadFile> paginatedList);

	public int deleteByPk(Long tempUploadFilePk);

	/**
	 * 更新轉入結果
	 * @param tempUploadFile
	 * @return
	 */
	public int updateFileImportStatus(TempUploadFile tempUploadFile);

	/**
	 * 以主鍵取得物件
	 * @param tempUploadFilePk
	 * @return
	 */
	public TempUploadFile getTempUploadFileByPk(Long tempUploadFilePk);

	/**
	 * 查詢可上傳的交割款檔案(含以上傳驗資檔)<BR/>
	 * 交割款上傳使用
	 * @param tempUploadFile
	 * @param uploaddDateFrom
	 * @param uploadDateTo
	 * @param paginatedList
	 * @return
	 */
	public PaginatedList<TempUploadFile> queryForPaginatedListByFormatIs2(
			TempUploadFile tempUploadFile, Date uploaddDateFrom,
			Date uploadDateTo, 
			PaginatedList<TempUploadFile> paginatedList);
}
